<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php
echo "<title>".$title_for_layout."</title>";
echo $html->css('template');
echo $html->css('jquery-ui-1.8.9.custom');
echo $html->css('selectmenu');
echo $html->script('jquery');
echo $html->script('jquery.blockUI');
echo $html->script('jquery-ui-1.8.9.custom.min');
echo $html->script('jquery.ui.selectmenu');
echo $html->script('jquery.validate.pack');

echo $scripts_for_layout;
?>
<script type="text/javascript">
$(document).ajaxStart(function(){$('#content').block({message:'Please wait...'});});           
$(document).ajaxStop(function(){$('#content').unblock();});
function saveUI()
{
	$.growlUI('Webukkit', 'Save succeed!');
}
$(function(){
$('select#langage').selectmenu({
	icons: [{find: '.avatar'}],
	bgImage: function() {return 'url(' + $(this).attr("title") + ')';},
	select: function(event, options) {
	var selectedLangage = options.value;
	<?php
		echo $js->request(array('controller'=>'users','action'=>'setlang'),array('data'=>'{lang:options.value}','dataExpression'=>true,'method'=>'post'));
	?>
	},
});
$('select#langage').selectmenu("value","<?php echo $lang; ?>");
});
</script>
</head>

<body>
<div id="page_bg">
<div id="header">
<div id="wrapper">
<table cellspacing="0" cellpadding="0" class="logo">
<tbody><tr>
<td>
<h1><a href="<?php echo $this->webroot;?>"><?php echo $title_for_layout; ?><sup><?php if (!empty($version)) echo $version; ?></sup></a></h1>
</td>
</tr>
</tbody></table>
</div>
</div>

<div class="content_middle_bg">
<div class="content_top_bg">
<div class="content_bottom_bg">
<div id="top_menu">
<ul id="mainlevel-nav">
<li>
<?php
$user = $session->read('Auth.User');
if ($user['group']==1)
	echo $html->link(__('Admin',true),array('controller'=>'private','action'=>'index'));
?>
</li>
<li>
<?php
if (!empty($showstats) && $showstats)
{
	echo $this->Js->link
	(
	__('Stats',true),
	array('controller' => 'public','action'=>'showstats'),
	array(
	'update' => '#content',
	'class'=>'mainlevel-nav',
	)
		);
}
?>
</li>
<li>
<?php
if (!empty($showstats) && $showstats)
{
	echo $this->Js->link
	(
	__('Players',true),
	array('controller' => 'public','action'=>'showplayers'),
	array(
	'update' => '#content',
	'class'=>'mainlevel-nav',
	)
		);
}
?>
</li>
<li>
<?php
if (!empty($showmap) && $showmap)
{
	echo $this->Js->link
	(
	__('Map',true),
	array('controller' => 'public','action'=>'view_map'),
	array(
	'update' => '#content',
	'class'=>'mainlevel-nav',
	)
		);
}
?>
</li>
<li>
<?php
if(!empty($user))
	{ 
	echo $this->Js->link(__('Your account',true),array('controller'=>'users','action'=>'editprofile'),array(
	'update' => '#content',
	'class'=>'mainlevel-nav',
	));
?>
</li>
<?php
	echo $html->link($html->image("deconnexion.png",array('alt'=>'logout','title'=>'Logout')),array('controller'=>'users','action'=>'logout'),array('style'=>'float:left','escape'=>false));
}
else
{
	?>
	<li>
	<?php
	echo $html->link(__('Login',true),array('controller'=>'users','action'=>'login'));
	?>
	</li>
	<li>
	<?php
	echo $html->link(__('Register',true),array('controller'=>'users','action'=>'register'));
	?>
	</li>
	<?php	
}
?>
<div id='langagebar' style='float:right'>
<select name="langage" id="langage">
<option value="eng" class="avatar" title="<?php echo $this->webroot; ?>img/flag_united_kingdom.gif"></option>
<option value="fre" class="avatar" title="<?php echo $this->webroot; ?>img/flag_france.gif"></option>
</select>
</div>
</ul>	

</div>

<div><div class="clr"></div></div>

<div class="blog" id="content">
<?php echo $content_for_layout; ?>
</div>

</div>
</div>
</div>

<?php echo $this->element('sql_dump'); ?>
<?php echo $this->Js->writeBuffer(); ?>
</div>
<div id="footer">
<center>Powered by <a href="http://forums.bukkit.org/threads/web-admn-webukkit-v0-beta8.4141/" target="_blank">Webukkit</a></center>
</div>

</body>
